/*
 * Copyright (c) 2025 [ByteDance Ltd. and/or its affiliates.] and/or its affiliates
 * SPDX-License-Identifier: LGPL v2.1+
*/
#ifndef FFMPEG_OP_CRYPTOR_H
#define FFMPEG_OP_CRYPTOR_H

#ifdef __cplusplus
extern "C"
{
#endif
#include "libavformat/avformat.h"

typedef struct FFCrptorParams {
    uint32_t step;
    uint32_t lenght;
    uint8_t  key;
}FFCrptorParams;

void* createIODeCrptorContext(AVFormatContext *formatCtx, const char *url, const AVDictionary *options, const FFCrptorParams params);

void clearFormatContext(void* deCryptor);

void* createIOEnCrptorContext(AVFormatContext *formatCtx, const char *url, const AVDictionary *options, const FFCrptorParams params);

int writeBdveTag(void* enCryptor, int writeParam);

void destoryIOCryptor(void* ioCrptor);

void destroyIODecryptor(void* ioCrptor);

#ifdef __cplusplus
}
#endif

#endif //FFMPEG_OP_CRYPTOR_H

